
from urllib import request
# 1.设置代理ip集合
已修改代码
proxy_handler=request.ProxyHandler({
    'http':'http://112.194.112.175:8118',
    'https':'https://121.237.149.66:3000'
})
# 2.通过代理构造一个Opener
opener=request.build_opener(proxy_handler)
# 3.使用opnner发起请求
response=opener.open('https://httpbin.org/ip')
# 4.输出ip到控制台
print(response.read().decode('utf-8'))
